package cn.taoticket.service;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.taoticket.mapper.TaoticketSchedulerMapper;
import cn.taoticket.pojo.TaoticketScheduler;

import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by taoticket
 */
@RestController
public class RestTaoticketSchedulerService {

    @Resource
     private TaoticketSchedulerMapper taoticketSchedulerMapper;

     @RequestMapping(value = "/getTaoticketSchedulerById",method = RequestMethod.POST)
     public TaoticketScheduler getTaoticketSchedulerById(@RequestParam("id") Long id)throws Exception{
        return taoticketSchedulerMapper.getTaoticketSchedulerById(id);
     }

     @RequestMapping(value = "/getTaoticketSchedulerListByMap",method = RequestMethod.POST)
     public List<TaoticketScheduler>	getTaoticketSchedulerListByMap(@RequestParam Map<String,Object> param)throws Exception{
        return taoticketSchedulerMapper.getTaoticketSchedulerListByMap(param);
     }

     @RequestMapping(value = "/getTaoticketSchedulerCountByMap",method = RequestMethod.POST)
     public Integer getTaoticketSchedulerCountByMap(@RequestParam Map<String,Object> param)throws Exception{
        return taoticketSchedulerMapper.getTaoticketSchedulerCountByMap(param);
     }

     @RequestMapping(value = "/qdtxAddTaoticketScheduler",method = RequestMethod.POST)
     public Integer qdtxAddTaoticketScheduler(@RequestBody TaoticketScheduler taoticketScheduler)throws Exception{
        taoticketScheduler.setCreatedTime(new Date());
        return taoticketSchedulerMapper.insertTaoticketScheduler(taoticketScheduler);
     }

     @RequestMapping(value = "/qdtxModifyTaoticketScheduler",method = RequestMethod.POST)
     public Integer qdtxModifyTaoticketScheduler(@RequestBody TaoticketScheduler taoticketScheduler)throws Exception{
        taoticketScheduler.setUpdatedTime(new Date());
        return taoticketSchedulerMapper.updateTaoticketScheduler(taoticketScheduler);
     }
}
